<template>
  <div class="rightmain_container">
    <div class="oprations_box">
      <div class="left_search">
        <el-icon :size="20" color="#444545">
          <Tickets />
        </el-icon>
        <span>数据列表</span>
      </div>
      <div class="right_btn">
        <!-- 给添加按钮 绑定 弹窗组件和相关的数据 -->
        <el-button @click="">添加</el-button>
      </div>
    </div>
    <!-- 详情表单信息 -->
    <div class="table_box">
      <el-table :data="lists" border style="width: 100%" :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{ 'text-align': 'center' }">
        <el-table-column prop="id" label="编号" />
        <el-table-column prop="product.name" label="商品名称" />
        <el-table-column prop="productId" label="货号" />
        <el-table-column prop="flashPromotionPrice" label="商品价格" />
        <el-table-column prop="flashPromotionCount" label="剩余数量" />
        <el-table-column prop="product.promotionPrice" label="秒杀价格" />
        <el-table-column prop="product.albumPics" label="秒杀数量" />
        <el-table-column prop="flashPromotionLimit" label="限购数量"></el-table-column>
        <el-table-column prop="sort" label="排序" />
        <el-table-column prop="email" label="操作">

          <template #default="{ row }">
            <el-button type="primary" link @click="">编辑</el-button>
            <el-button type="primary" link @click="">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script setup lang="ts">
import { Tickets } from "@element-plus/icons-vue";
import { ApiflashProductRelationList } from "@/http//hjh.api.ts"
import { useRoute } from "vue-router"
import { reactive, ref } from "vue";


const route = useRoute()

const lists = ref([])


const propoRoutws = reactive({
  pageNum: 1,
  pageSize: 5,
  flashPromotionSessionId: route.query.flashPromotionSessionId,
  flashPromotionId: route.query.flashPromotionId
})





// 数据xuan'r
ApiflashProductRelationList(propoRoutws).then(res => {
  if (res.code === 200) {
    lists.value = res.data.list
    console.log(lists);
  }
})





</script>
<style lang="less" scoped>
.rightmain_container {
  .left_search {
    display: flex;
    align-items: center;

    span {
      font-size: 14px;
      color: #303133;
      margin-left: 10px;
    }
  }

  .oprations_box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    box-shadow: 0 0 4px 2px #eee;
    margin-bottom: 20px;
    border-radius: 2px;
  }
}
</style>
